import java.util.*;

public class Board {
    public boolean checkWon(int[][] board) {
        // write code
        for (int i = 0; i < 3; i++) {
            if (i == 0 && board[0][i] == 1) {
                if (board[1][0] == 1 && board[2][0] == 1) {
                    return true;
                }
                if (board[0][1] == 1 && board[0][2] == 1) {
                    return true;
                }
                if (board[1][1] == 1 && board[2][2] == 1) {
                    return true;
                }
            } else if (i == 1 && board[0][i] == 1) {
                if (board[1][1] == 1 && board[2][1] == 1) {
                    return true;
                }
            } else if (i == 2 && board[0][i] == 1) {
                if (board[1][2] == 1 && board[2][2] == 1) {
                    return true;
                }
                if (board[1][1] == 1 && board[2][0] == 1) {
                    return true;
                }
            }
        }
        return false;
    }
}